#include "stack_base_list.h"
#include <stdio.h>
#include <stdlib.h>

int main(){
	int x = 0,y = 0;
	printf("请输入10进制数：\n");
	scanf("%d",&x);
	printf("请输入转换进制数:\n");
	scanf("%d",&y);
	STACK *stack = stack_create();
	while(x){
		stack_push(stack,x%y);
		x=x/y;
		}
	while(! stack_empty (stack)){
			/*if(x>0&&x<16){
			printf("%d",stack_pop(stack));
			}*/
			int res =  stack_pop(stack);
			if(res < 10){
				printf("%d",res);
				}else{
				printf("%c",res-10+'A');
					}
		}
		printf("\n");
	stack_destory(stack);
	return 0;
	}
